AbstractForm = function() {

    // Privatne varijable
    var privateVariable = '';

    Ext.applyIf(this.formConfig || {}, {
        id: 'abstractFormId',
        baseCls: 'x-plain',
        border:true,
        defaults: {
            anchor: '95%',
            msgTarget: 'side'
        },
        items : [],
        buttons: []
    });

    this.formPanel = new Ext.form.FormPanel(this.formConfig);

    Ext.applyIf(this, {
        id: 'abstractFormWindowId'
        //,title: 'Abstract form'
        ,autoHeight:true
        ,autoWidtht:true
        //,width:400
        ,bodyStyle:'padding:5px;'
        ,buttonAlign:'center'
        ,modal:true
        ,stateful:false
        ,border:true
        ,items:[this.formPanel]
        ,keys: [{
          key: Ext.EventObject.ENTER,
          fn: function(){},
          scope:this
        }]
    });

    AbstractForm.superclass.constructor.call(this);

    this.getForm().on('beforeaction', function(basicForm, action) {
        this.el.mask('Please wait...', 'x-mask-loading');
    }, this);

    this.getForm().on('actionfailed', function(basicForm, action) {
        this.el.unmask();
    }, this);

    this.getForm().on('actioncomplete', function(basicForm, action) {
        this.el.unmask();
    }, this);

};

Ext.extend(AbstractForm, Ext.Window, {
    onRender : function(ct, position){
        this.formPanel.getForm().setValues(this.valueData);
        AbstractForm.superclass.onRender.call(this, ct, position);
    },

    getForm : function() {
        return this.formPanel.getForm();
    },

    getFormPanel : function() {
        return this.formPanel;
    }
});

Ext.reg('abstractForm', AbstractForm);